home *** CD-ROM | disk | FTP | other *** search
- Path: andrew.cmu.edu!ro2m+
- From: Randy O'Reilly <oreilly+@CMU.EDU>
- Newsgroups: gnu.emacs.help,comp.lang.c++
- Subject: C++ Editing Idea: Already Available?
- Date: Sat, 27 Jan 1996 20:01:05 -0500
- Organization: Doctoral student, Psychology, Carnegie Mellon, Pittsburgh, PA
- Message-ID: <8l2gfFO00jW=Q6ZoBO@andrew.cmu.edu>
- NNTP-Posting-Host: po9.andrew.cmu.edu
-
- Having developed a large C++ library for doing neural network
- simulation, we have found that the main problem people face in using
- it to develop their own code could be solved by a smart editor that
- has the following features. I would like to know if something like
- this is already available for UNIX systems, preferably in emacs. If
- not, anybody want to write this in elisp? Thanks in advance for any
- info!
-
- - Randy
-
- Problem: Can't tell what a function *really* does because it calls
- parent version of function, or member functions:
-
- void BpUnit::Compute_Act() {
- Unit::Compute_Act(); // do standard activation computation
- act += rnd_noise.Gen(); // add random noise
- }
-
- Solution: If one could double-click (or whatever) on the
- 'Unit::Compute_Act()' call above and get something like the following
- display:
-
- void BpUnit::Compute_Act() {
- Unit::Compute_Act(); { // defined at: ../pdp/netstru.cc:320
- act = 1.0 / (1.0 + exp(-net));
- }
- act += rnd_noise.Gen(); // add random noise
- }
-
- which simply provides the definition of the parent function *inline*
- in the code (presumably protected from editing, but visible, probably
- in a different color or otherwise hilighted as such) and automatically
- commented with the location of this in some other source file (which
- could then be clicked on to get to the actual source file to edit it).
-
- this could be done with all function calls (on any object, etc):
-
- void BpUnit::Compute_Act() {
- Unit::Compute_Act(); { // defined at: ../pdp/netstru.cc:320
- act = 1.0 / (1.0 + exp(-net));
- }
- act += rnd_noise.Gen(); { // defined at: ../ta_misc/random.h:53
- return (drand48() * var) + mean;
- }
- }
-
- after viewing the function definition, another double-click would
- revert to the actual text of the current function, etc.
-
- the ability to view code *inline* instead of having to flip back and
- forth over 10's of source files is the key to making this useful --
- the tags facility in emacs, while better than nothing, does not allow
- one to see in one place exactly what is happening, which is so often
- useful for people to figure out what you wrote and how they can use
- that to suit their own needs. flipping back and forth and trying to
- keep things in memory just doesn't work very well.
-
-